package com.hllxd.hism.star.basic.service.service;

import com.hllxd.hism.star.basic.service.dao.mapper.mis.TopicRealtimeOfftableInfoMapper;
import com.hllxd.hism.star.basic.service.model.TopicRealtimeOfftableInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service("RtTopicConfigService")
public class RtTopicConfigServiceImpl implements RtTopicConfigService {

    @Autowired
    private TopicRealtimeOfftableInfoMapper topicRealtimeOfftableInfoMapper;


    @Override
    public List<TopicRealtimeOfftableInfo> listTopicConfig() {
        return topicRealtimeOfftableInfoMapper.listTopicConfig();
    }

    @Override
    public Long setTopicRealtimeOfftableInfo(TopicRealtimeOfftableInfo aa) {
        Long id;
        if (aa.getId() != null && aa.getId() > 0) {
            id = topicRealtimeOfftableInfoMapper.updateTopicConfig(aa);
        } else {
            id = topicRealtimeOfftableInfoMapper.insertTopicConfig(aa);
        }
        return id;
    }

    @Override
    public Long delTopicRealtimeOfftableInfo(Long id) {
        return topicRealtimeOfftableInfoMapper.deleteById(id);
    }

    @Override
    public TopicRealtimeOfftableInfo getTopicRealtimeOfftableInfo(Long id) {
        return topicRealtimeOfftableInfoMapper.getTopicRealtimeOfftableInfo(id);
    }
}
